{extend name="user:base" /}
{block name="main"}

<!-- begin::main content -->
<main class="main-content">

    <div class="userCon layui-col-md12  layui-col-space20">
        <div class="fly-panel fly-panel-user">
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title" id="LAY_mine">
                    <li class="layui-this" lay-id="info">{$title}</li>
                </ul>
                <div class="layui-tab-content" style="padding: 20px 0;">
                    <form method="post" class="layui-form">
                    <div class="layui-form-item">
                        {:uploader('img')}
                    </div>
                    <div class="layui-form layui-form-pane layui-tab-item layui-show">

                            <div class="layui-form-item layui-form-text">
                                <div class="layui-input-block">
                                    <textarea placeholder="图片简介" id="L_sign"  name="info" autocomplete="off" class="layui-textarea" ></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn" key="set-mine" lay-submit lay-filter="info">发布</button>
                            </div>

                    </div>
                    </form>
                </div>

            </div>
        </div>
    </div>




</main>

<script>
    //Demo
    layui.use(['form','layedit'], function(){
        var form = layui.form;
        // var layedit = layui.layedit;
        // edit = layedit.build('L_sign',
        //     {tool: [  'strong', '|', 'face']}
        // ); //建立编辑器
        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });

        form.on('submit(info)', function(data){
            var url = "{:url('Uimages/save')}";
            // data.info = layedit.getContent(edit);
            // if(!data.info){
            //     error("请填写内容");
            //     return false;
            // }
            $.post(url,data.field,function (e) {
                if(e.code ==200){
                    success(e.msg);
                    setTimeout("location.reload()",2000)
                }else {
                    error(e.msg);
                }
            })
            return false;
        });
    });

</script>
{/block}